package com.aaa.system.controller.api;

import com.aaa.entity.User;
import com.aaa.system.service.UserService;
import com.aaa.system.vo.UserVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: his-open-parent
 * @description:
 * @author: 闫克起2
 * @create: 2023-03-20 11:05
 **/
@RestController
@RequestMapping("system/api/user")
public class ApiUserController {

    @Autowired
    private UserService userService;
    @GetMapping("/info")
    public Result<User> getInfo(){
        return userService.getUserInfo();
    }

    @PostMapping("searchUser/{currentPage}/{pageSize}")
    public Result<IPage<User>> searchUser(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody UserVo userVo
    ){
        return userService.findByCondition(currentPage,pageSize,userVo);
    }
}
